package week1;

public class LinkedList {
    public static void main(String[] args) {
        student2 student=new  student2 ("郭恺", 20172301,"爱学习");
        student2 Head=student;


    }
    public static void PrintLinkedList(student2 Head) {
        student2 node = Head;
        while (node != null) {
            System.out.println("姓名" + node.name + "学号" + node.number + "爱好" + node.hobby);
            node = node.next;
        }
    }
    public static void InsertNode(student2 Head, student2 node) {
        student2 node1;
        if (Head==null)
            Head=node;
        else
        {
            node1=Head;
            while(node1.next!=null)
                node1=node1.next;
            node1.next=node;
        }

    }
}
